<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Turmas</title>
        <head>
            <link rel="stylesheet" href="../css/ui-lightness/jquery-ui-1.8.2.custom.css">
            <script type="text/javascript" src="../js/jquery.js" ></script>
            <script type="text/javascript" src="../js/jquery-ui-1.8.2.custom.min.js" ></script>
            <link rel="stylesheet" href="../css/forms.css">

        </head>
    </head>
    <SCRIPT>
        $(function() {
            $( "#tabs" ).tabs();
        });
    </SCRIPT>

    <body class="semfundo">
        <div style="width:980px;margin:0 auto;position:static" >
            <div id="tabs" >
                <sql:query var="query" dataSource="jdbc/dbo_MicrosoftSQLServer">
                    SELECT  id_turma, codigo_turma,id_turma_principal FROM Turmas
                    where id_turma=?
                    union
                    SELECT  id_turma, codigo_turma,id_turma_principal FROM Turmas
                    where id_turma_principal=?
                    order by id_turma
                    <sql:param value="${param.chave}"/>
                    <sql:param value="${param.chave}"/>
                </sql:query>

                <ul>
                    <c:forEach var="row" items="${query.rows}">
                        <li><a href="#tabs-${row.id_turma}">${row.id_turma_principal==null?'Turma':'SubTurma'} ${row.codigo_turma}</a></li>
                    </c:forEach>
                </ul>
                <c:forEach var="row" items="${query.rows}">
                    <div id="tabs-${row.id_turma}">
                        <iframe name="frame-${row.id_turma}" src="fm_update_turmas.jsp?token=${sessionScope.token}&chave=${row.id_turma}"
                                width="950"
                                scrolling="NO"
                                frameborder="0"
                                height="2800"
                                >

                        </iframe>

                    </div>
                </c:forEach>
            </div>
        </div>


    </body>
</html>
